package com.i_art_engineer.meigong.base;

import android.view.View;

import com.i_art_engineer.meigong.R;
import com.i_art_engineer.meigong.widget.ActionBar;

/**
 * 带退出功能的ActionBar的界面基类
 */
public class ActionBarActivity extends FullScreenActivity {

    protected ActionBar actionBar;

    /**
     * 初始化
     *
     * @param titleRes
     */
    public void initActionBar(int titleRes) {
        actionBar = (ActionBar) findViewById(R.id.actionBar);

        if (actionBar != null) {
            actionBar.setTitleView(getString(titleRes));
            actionBar.setLeftButton(R.drawable.btn_back, new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    ActionBarActivity.this.finish();
                }
            });
        }
    }

}
